program Bubble;

{$APPTYPE CONSOLE}
const
n = 15;
var
a : array of integer;
i : integer;
procedure BubbleSort;
var i, j, temp : integer;
begin
  for i:=0 to n-2 do
    for j:=0 to n-2-i do
    begin
      if a[j] > a[j+1] then
      begin
        temp := a[j];
        a[j] := a[j+1];
        a[j+1] := temp;
      end;
    end;
end;
begin
  setlength(a, n);
  randomize;
  for i:=0 to n-1 do
    a[i] := random(50);
  BubbleSort;
  for i:=0 to n-1 do
    write(a[i],' ');
  readln;
end.
 